﻿using DimensionsHelper.SourceGeneration.Resources;
using Microsoft.CodeAnalysis;
using System;

namespace DimensionsHelper.SourceGeneration.Constants
{
    internal class ConstantsDiagnostics
    {

        private static DiagnosticDescriptor CreateDescriptor(string id, LocalizableString title, LocalizableString message, string category, DiagnosticSeverity severity, bool isEnabledByDefault = true, LocalizableString description = null)
        {
            return new DiagnosticDescriptor(id, title, message, category, severity, isEnabledByDefault, description);
        }


        private const string DimensionsHelperCLSourceGenerationName = "DimensionsHelper.CommandLine.SourceGeneration";
        private static readonly Type ResourceSource = typeof(Messages);


        public static DiagnosticDescriptor MethodIsNotExist { get; } = CreateDescriptor(
            "DHC1001",
            new LocalizableResourceString(nameof(Messages.MethodIsNotExistTitle), Messages.ResourceManager, ResourceSource),
            new LocalizableResourceString(nameof(Messages.MethodIsNotExist), Messages.ResourceManager, ResourceSource),
            DimensionsHelperCLSourceGenerationName,
            DiagnosticSeverity.Warning);


        public static DiagnosticDescriptor UnmatchedType { get; } = CreateDescriptor(
            "DHC1002",
            new LocalizableResourceString(nameof(Messages.UnmatchedTypeTitle), Messages.ResourceManager, ResourceSource),
            new LocalizableResourceString(nameof(Messages.UnmatchedType), Messages.ResourceManager, ResourceSource),
            DimensionsHelperCLSourceGenerationName,
            DiagnosticSeverity.Warning);



    }
}
